﻿<%@ Page Title="Register" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="Register.aspx.cs" Inherits="TwoWheels.Account.Register" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <asp:CreateUserWizard ID="RegisterUser" runat="server" EnableViewState="False" 
        OnCreatedUser="RegisterUser_CreatedUser">
        <LayoutTemplate>
            <asp:PlaceHolder ID="wizardStepPlaceholder" runat="server"></asp:PlaceHolder>
            <asp:PlaceHolder ID="navigationPlaceholder" runat="server"></asp:PlaceHolder>
        </LayoutTemplate>
        <WizardSteps>
            <asp:CreateUserWizardStep ID="RegisterUserWizardStep" runat="server">
                <ContentTemplate>
                    <h2>
                        Create a New Account
                    </h2>
                    <p>
                        Use the form below to create a new account.
                    </p>
                    <p>
                        Passwords are required to be a minimum of <%= Membership.MinRequiredPasswordLength %> characters in length.
                    </p>
                    <span class="failureNotification">
                        <asp:Literal ID="ErrorMessage" runat="server"></asp:Literal>
                    </span>
                    <asp:ValidationSummary ID="RegisterUserValidationSummary" runat="server" CssClass="failureNotification" 
                         ValidationGroup="RegisterUserValidationGroup"/>
                    <div class="accountInfo">
                        <fieldset class="register">
                            <legend>Account Information</legend>
                            <p>
                                <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">e-mail:</asp:Label>
                                <asp:TextBox ID="UserName" runat="server" CssClass="textEntry"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName" 
                                     CssClass="failureNotification" ErrorMessage="User Name is required." ToolTip="User Name is required." 
                                     ValidationGroup="RegisterUserValidationGroup">*</asp:RequiredFieldValidator>
                            </p>
                            <p>
                                <asp:Label ID="UserSurnameLabel" runat="server" AssociatedControlID="UserSurname">Surname:</asp:Label>
                                <asp:TextBox ID="UserSurname" runat="server" CssClass="textEntry"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="UserSurnameRequired" runat="server" ControlToValidate="UserSurname" 
                                     CssClass="failureNotification" ErrorMessage="User Surname is required." ToolTip="User Su is required." 
                                     ValidationGroup="RegisterUserValidationGroup">*</asp:RequiredFieldValidator>
                            </p>
                            <p>
                                <asp:Label ID="EmailLabel" runat="server" AssociatedControlID="Email">Name:</asp:Label>
                                <asp:TextBox ID="Email" runat="server" CssClass="textEntry"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="EmailRequired" runat="server" ControlToValidate="Email" 
                                     CssClass="failureNotification" ErrorMessage="E-mail is required." ToolTip="E-mail is required." 
                                     ValidationGroup="RegisterUserValidationGroup">*</asp:RequiredFieldValidator>
                            </p>
                            <p>
                                <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label>
                                <asp:TextBox ID="Password" runat="server" CssClass="passwordEntry" TextMode="Password"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password" 
                                     CssClass="failureNotification" ErrorMessage="Password is required." ToolTip="Password is required." 
                                     ValidationGroup="RegisterUserValidationGroup">*</asp:RequiredFieldValidator>
                            </p>
                            <p>
                                <asp:Label ID="ConfirmPasswordLabel" runat="server" AssociatedControlID="ConfirmPassword">Confirm Password:</asp:Label>
                                <asp:TextBox ID="ConfirmPassword" runat="server" CssClass="passwordEntry" TextMode="Password"></asp:TextBox>
                                <asp:RequiredFieldValidator ControlToValidate="ConfirmPassword" CssClass="failureNotification" Display="Dynamic" 
                                     ErrorMessage="Confirm Password is required." ID="ConfirmPasswordRequired" runat="server" 
                                     ToolTip="Confirm Password is required." ValidationGroup="RegisterUserValidationGroup">*</asp:RequiredFieldValidator>
                                <asp:CompareValidator ID="PasswordCompare" runat="server" ControlToCompare="Password" ControlToValidate="ConfirmPassword" 
                                     CssClass="failureNotification" Display="Dynamic" ErrorMessage="The Password and Confirmation Password must match."
                                     ValidationGroup="RegisterUserValidationGroup">*</asp:CompareValidator>
                            </p>
                                <br />
                                <hr />
                                <br />
                            <p>  
                                <label>Additional information:</label> 
                            </p>
                            <p>
                                <asp:Label ID="NationLabel" runat="server" >State:</asp:Label><br />
                                <asp:TextBox ID="NationTextBox" runat="server" Enabled="true"></asp:TextBox>
                            </p>
                            <p>
                                <asp:Label ID="CityLabel" runat="server">City:</asp:Label><br />
                                <asp:TextBox ID="CityTextBox" runat="server" Enabled="true"></asp:TextBox>
                            </p>
                            <p>
                                <asp:Label ID="AddressLabel" runat="server">Address:</asp:Label><br />
                                <asp:TextBox ID="AddressTextBox" runat="server" Enabled="true"></asp:TextBox>
                            </p>
                            <p>
                                <asp:Label ID="PostCodeLabel" runat="server">PostCode:</asp:Label><br />
                                <asp:TextBox ID="PostCodeTextBox" runat="server" Enabled="true"></asp:TextBox>
                            </p>
                            <p>
                                <asp:Label ID="PhoneLabel" runat="server">Phone number:</asp:Label><br />
                                <asp:TextBox ID="PhoneTextBox" runat="server" Enabled="true"></asp:TextBox>
                            </p>
                            
                                <br />
                                <hr />
                                <br />
                             
                            <p>      
                                <table>
                                 <tr>
                                  <td>
                                   <asp:CheckBox ID="CompanyCheckBox" runat="server" OnCheckedChanged="onCheckChanged" AutoPostBack="true"/> 
                                  </td>
                                  <td>
                                   <asp:Label ID="Label1" runat="server">Company</asp:Label>
                                  </td>
                                 </tr>
                                </table>                                 
                            </p>
                            <p>                                
                                <asp:Label ID="CompanyNameLabel" runat="server" AssociatedControlID="CompanyNameLabel">CompanyName:</asp:Label>                                                          
                                <asp:TextBox ID="CompanyNameTextBox" runat="server" Enabled="false" BackColor="LightGray" ></asp:TextBox>
                            <p>
                                <asp:Label ID="NIPCompanyLabel" runat="server" AssociatedControlID="NIPCompanyLabel">NIP:</asp:Label>
                                <asp:TextBox ID="NIPTextBox" runat="server" Enabled="false" BackColor="LightGray"></asp:TextBox>
                            </p>
                                
                            </p>
                        </fieldset>
                        <p class="submitButton">
                            <asp:Button ID="CreateUserButton" runat="server" CommandName="MoveNext" Text="Create User" 
                                 ValidationGroup="RegisterUserValidationGroup"/>
                        </p>
                    </div>
                </ContentTemplate>
                <CustomNavigationTemplate>
                </CustomNavigationTemplate>
                
            </asp:CreateUserWizardStep>

            <asp:CompleteWizardStep ID="CompleteRegisterUserWizardStep" runat="server">
                
                <ContentTemplate>
                    <table>
                        <tr>
                            <td align="center">
                                Complete</td>
                        </tr>
                        <tr>
                            <td>
                                Your account has been successfully created.</td>
                        </tr>
                        <tr>
                            <td align="right">
                                <asp:Button ID="ContinueButton" runat="server" CausesValidation="False" 
                                    CommandName="Continue" Text="Continue" ValidationGroup="RegisterUser" 
                                    onclick="ContinueButton_Click" />
                            </td>
                        </tr>
                    </table>
                </ContentTemplate>
                
            </asp:CompleteWizardStep>
        
        </WizardSteps>
    </asp:CreateUserWizard>
    
</asp:Content>
